<?php
/**
 * @author Martin Pernica
 * @copyright 2009
 */

Text::h2("Nová kategorie políček");
echo '<br /><h3><a href="index.php?p=components&name=user&a=fields">Zpět</a></h3><br />';

$form = new Form("", "post");

$form->addElement("input", array("type" => "text", "name" => "title", "value" =>
    $_POST['title'], "label" => "Nadpis"));

$form->addElement("input", array("type" => "submit", "name" => "submit", "value" =>
    SUBMIT));

$form->render();

if ($form->isSubmitted()) {
    $query = $db->query("INSERT INTO {prefix}fields_cats(`title`) VALUES( '" . $_POST['title'] . "')");
    echo $db->error;
    if ($query) {
        $log->write(8, 'com_user', 'NOW()', 'User added field cat ' . $_POST['title'],
            $_SESSION['id']);
        $event = 'roar.alert(\'Status\', \'Kategorie byla přidána !\');';
        array_push($Roar, $event);
    }
}

?>